package com.zhouxiaoge.拦截过滤器模式;

/**
 * @author 周小哥  gqzmy@163.com 2022/10/11 0:01
 * <p>
 * 过滤器管理器
 */

public class FilterManager {

    private final FilterChain filterChain;

    public FilterManager(Target target) {
        filterChain = new FilterChain();
        filterChain.setTarget(target);
    }

    public void setFilter(Filter filter) {
        filterChain.addFilter(filter);
    }

    public void filterRequest(String request) {
        filterChain.execute(request);
    }
}
